<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<HTML   xmlns:th="http://www.thymeleaf.org"
        xmlns="http://www.w3.org/1999/xhtml">
<HEAD>
    <META content="IE=11.0000"
          http-equiv="X-UA-Compatible">

    <META http-equiv="Content-Type" content="text/html; charset=utf-8">
    <TITLE>发布新投票</TITLE>
    <SCRIPT src="js/jquery-1.12.4.js" type="text/javascript"></SCRIPT>

    <SCRIPT type="text/javascript">

        $(function(){
            $("#voteoptions p a:first").remove();
            $("#voteoptions p a:first").remove();
        })

        function update(){
            var p ='<P><INPUT name="option" class="input-text" type="text"><input name="oid" type="hidden"/><a onclick="del($(this))" href="javascript:void(0)">删除</a></P>';
            $("#voteoptions").append(p)
        }

        function del(t){
            t.parent().remove();
        }

        function dd(t){
            $(t).parent().remove();
        }

    </SCRIPT>
    <LINK href="css/style.css" rel="stylesheet" type="text/css">

    <META name="GENERATOR" content="MSHTML 11.00.10586.420">
</HEAD>
<BODY>
<DIV class="wrap" id="header"><IMG src="images/logo.gif"></DIV>
<DIV class="box" id="voteManage">
    <H2>添加新投票</H2>
    <DIV class="content">
        <FORM  action="weihu">
            <DL>
                <DT>投票内容：</DT>
                <DD>
                    <INPUT th:value="${subject.title}" name="title" class="input-text" id="title" type="text">
                </DD>
                <dt>投票方式：</dt>
                单选<INPUT name="type" value="1" class="input-text" type="radio" checked>
                多选<INPUT name="type" value="2" class="input-text" type="radio">
                <DT>投票选项：</DT>
                <DD id="voteoptions">
                    <P th:each="o:${session.olist}">
                        <INPUT th:value="${o.option}" name="option" class="input-text" type="text">
                        <input name="oid" type="hidden" th:value="${o.oid}"/>
                        <a onclick="dd(this)" href="#">删除</a>
                    </P>
                </DD>
                <DD class="button">
                    <INPUT type="image" src="images/button_submit.gif">
                    <A onclick="update()" href="javascript:void(0)">增加选项</A>
                    <A href="slist">取消操作</A>
                </DD>
            </DL>
        </FORM>
    </DIV>
</DIV>
<DIV class="wrap" id="footer"> 北大青鸟 © 版权所有</DIV>
</BODY>
</HTML>
